<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center newPhone_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub newPhone_fd0_0'>
          <view class='flex flex-wrap align-center newPhone_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="switchTab"
            :data-url="`/pages/tabBar/mine/mine`">
            <text class='fu-iconfont2  newPhone_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='newPhone_fd0_0_c1_c0'>绑定手机</text>
          </view>
          <view class='flex flex-wrap align-center justify-end newPhone_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-direction flex-wrap align-stretch benben-flex-layout newPhone_flex_1">
        <view class='flex flex-direction flex-wrap align-stretch flex-sub newPhone_fd1_0'>
          <view class='flex flex-wrap align-center justify-between flex-sub newPhone_fd1_0_c0'>
            <text class='newPhone_fd1_0_c0_c0'>手机号码：</text>
            <benben-input class='newPhone_fd1_0_c0_c1' type="text" :placeholder="`请输入手机号`" confirm-type="done"
              :maxlength="11" :adjust-position='true' v-model="phone"
              placeholder-style="color:rgba(162, 162, 162, 1);font-size:28rpx" />
          </view>
          <view class='flex flex-wrap align-center justify-between flex-sub newPhone_fd1_0_c1'>
            <text class='newPhone_fd1_0_c0_c0'>短信验证：</text>
            <benben-input class='newPhone_fd1_0_c1_c1' type="text" :placeholder="`请输入验证码`" confirm-type="done"
              :maxlength="-1" :adjust-position='true' placeholder-style="color:rgba(162, 162, 162, 1);font-size:28rpx"
              v-model="code" />
            <benben-send-verification-code key='1724830134548' ref="vCode1724830134548" class='newPhone_fd1_0_c1_c2'
              after-text='后重新获取' before-text='获取验证码' emptye-text='请输入账号' validate-text='请输入正确账号' account-type='phone'
              :auto='true' :is-environment-verification='true' type='5' :phone="phone"></benben-send-verification-code>
          </view>
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <view class="flex flex-direction flex-wrap align-center benben-position-layout flex newPhone_flex_2"
        :style="{height:(150+bottomSafeAreaRpx)+'rpx',paddingBottom:bottomSafeAreaRpx+'rpx', }">
        <button class='newPhone_fd2_0' @tap.stop="sumFunc">完成</button>

      </view>
      <view :style="{height: (150+bottomSafeAreaRpx)+'rpx'}"></view>


    </view>
  </page-body>
</template>
<script>
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},


    data() {
      return {
        "fd1_0_c1_c2": "mobile",
        "phone": "",
        "code1": {
          "code": ""
        },
        "code": ""
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {

    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      //基础功能-发送验证码
      async getwkb5bdc44796e8Func() {
        //请求方法
        //数据验证

        let datacode1 = await this.$api.post(global.apiUrls.post5b5bdc44796e8, {
          mobile: this.phone,
          type: '5'
        });

        if (datacode1.data.code != 1) {
          this.$message.info(datacode1.data.msg);
          return
        }
        let infocode1 = datacode1.data;
        this.code1 = infocode1.data

      },
      //提交
      async sumFunc() {
        if (!validate(this.phone, 'require')) {
          this.$message.info('手机号不能为空');
          return false;
        }
        if (!validate(this.code, 'require')) {
          this.$message.info('验证码不能为空');
          return false;
        }
        //请求方法
        //数据验证

        // let data5f6db4db8abcf = await this.$api.post(global.apiUrls.post5f6db4db8abcf, {
        //   mobile: this.phone,
        //   code: this.code,
        //   type: '5'
        // });

        // if (data5f6db4db8abcf.data.code != 1) {
        //   this.$message.info(data5f6db4db8abcf.data.msg);
        //   return
        // }
        // let info5f6db4db8abcf = data5f6db4db8abcf.data;





        let data5f6c915d69d1f = await this.$api.post(global.apiUrls.post68902a22a26af, {
          mobile: this.phone,
          code: this.code,
          type: '5',
		  step:2,
        });

        if (data5f6c915d69d1f.data.code != 1) {
          this.$message.info(data5f6c915d69d1f.data.msg);
          return
        }
        let info5f6c915d69d1f = data5f6c915d69d1f.data;
		uni.navigateBack()
        // this.$store.commit('logout')
        // this.toLoginDiy();
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F6f6f6;
    background-size: 100% auto;
  }

  .newPhone_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .newPhone_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .newPhone_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .newPhone_fd0_0_c0 {
    width: 120rpx;
  }

  .newPhone_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .newPhone_flex_1 {
    padding: 24rpx;
  }

  .newPhone_fd1_0_c1_c2 {
    background: #fef0de;
    min-width: 200rpx;
    line-height: 42rpx;
    text-align: center;
    font-size: 28rpx;
    color: rgba(136, 94, 23, 1);
    background-size: 100% auto;
    border-radius: 8rpx;
    padding: 8rpx 0rpx 8rpx 0rpx;
  }

  .newPhone_fd1_0_c1_c1 {
    text-align: right;
    width: 230rpx;
  }

  .newPhone_fd1_0_c1 {
    width: 100%;
    height: 200rpx;
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .newPhone_fd1_0_c0_c1 {
    text-align: right;
  }

  .newPhone_fd1_0_c0_c0 {
    font-size: 32rpx;
    line-height: 45rpx;
    color: rgba(51, 51, 51, 1);
  }

  .newPhone_fd1_0_c0 {
    border-bottom: 1px solid rgba(238, 238, 238, 1);
    width: 100%;
    height: 200rpx;
    padding: 32rpx 0rpx 32rpx 0rpx;
  }

  .newPhone_fd1_0 {
    background: #Fff;
    border-radius: 16rpx;
    background-size: 100% auto;
    padding: 0rpx 024rpx 0rpx 024rpx;
  }

  .newPhone_flex_2 {
    width: 750rpx;
    height: 150rpx;
    overflow: hidden;
    z-index: 10;
    bottom: calc(0rpx + var(--window-bottom));
  }

  .newPhone_fd2_0 {
    background:#145efd;
    border-radius: 45rpx;
    width: 638rpx;
    line-height: 88rpx;
    font-size: 32rpx;
    color: #fff;
    height: 88rpx;
  }
</style>
